<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!--
    	作者：845510257@qq.com
    	时间：2017-10-25
    	描述：title部分，公共js,公共css和jstl标签库
    -->
<%@include file="/source/page/parts/title.jsp"%>
<!-- 	下面引入本页面单独引入的资源 -->


<link rel="stylesheet"
	href="/GDZjiajiaowang/source/css/studentCenter.css" type="text/css" />
<script type="text/javascript"
	src="/GDZjiajiaowang/source/js/personalCenter.js" type="text/javascript" charset="UTF-8"></script>


</head>

<body>
	<!--
            	作者：GGVVR
            	时间：2017-10-25
            	描述：header部分（head_top、head_middle、head_botton）
            -->
	<%@include file="/source/page/parts/header.jsp"%>

	<!--
        	作者：972893248@qq.com
        	时间：2017-11-08
        	描述：个人中心
        -->
	<section>
		<div class="section_box clearfix">
			<div class="section_box_inside clearfix">
				<!--
                    	作者：972893248@qq.com
                    	时间：2017-11-10
                    	描述：左侧菜单切换
                    -->
				<div>
					<ul class="section_box_inside_left clearfix"
						id="section_box_inside_left_ul">
						<li class="click_change" id="first_select">个人资料</li>
						<li class="click_change" id="second_select">身份认证</li>
						<li class="click_change" id="third_select">待付款订单<span>0</span></li>
						<li class="click_change" id="fourth_select">申请记录</li>
						<li class="click_change" id="fifth_select">成功记录</li>
						<li class="click_change" id="seventh_select">修改密码</li>
						<li class="click_change" id="sisth_select">账户注销</li>
					</ul>
					<!--
                        	作者：972893248@qq.com
                        	时间：2017-11-10
                        	描述：右侧变化窗口1
                        -->
					<div
						class="section_box_inside_change_menuinfo clearfix section_box_left_div_comment_bywujinshan">
						<div class="section_box_inside_teachergeneral_info">
							<img src="/GDZjiajiaowang/source/img/stu0001.png"
								id="head_pic" />
							<ul>
								<li><span id="teacher_call">${personalCenterInfos.teacherUserName}</span>学员</li>
								<li>学生编号：<span id="color_as">T3124</span><span
									class="color_change" id="teacher_no">${personalCenterInfos.teacherId}</span>
								<span
									class="color_change" id="teacher_level">${personalCenterInfos.teacherLevel}</span></li>
								<li><span>简历浏览：</span><span id="click_times">${personalCenterInfos.clicks}</span><span>次</span><span
									id="recent_login">最近登录时间：</span><span id="update_time">${personalCenterInfos.teacherUpdateDate}</span></li>
								<li><span>认证情况：</span><span>尚未认证您的真实证件</span><span
									id="email_function">邮箱认证已通过</span></li>
							</ul>
						</div>
						<div class="undeline_useless"></div>
						<!--
                              	作者：972893248@qq.com
                              	时间：2017-11-10
                              	描述：下划线下部分
                              -->
						<div class="section_box_inside_step_introduce">
							<img src="/GDZjiajiaowang/source/img/wtitle.png" />

							<div class="section_box_inside_step_introduce_box">
								<div>
									<h4>1、加微信，随时查</h4>
								</div>
								<p>扫一扫，加关注，及时查看家教订单，学习，快人一步！</p>
								<p>还可随时申请订单。</p>
							</div>
							<div class="section_box_inside_step_introduce_box">
								<div>
									<h4>2、上传个人资料，补差补漏</h4>
								</div>
								<p>根据孩子的学习特点制定学习计划，及时的了解孩子的状态改进教学计划</p>
							</div>
							<div class="section_box_inside_step_introduce_box">
								<div>
									<h4>3、好老师才是真爱 提分经不起等待</h4>
								</div>
								<p>尽量将您的资料填写详细，并突出您的特点和学习方式，为您推荐合适的老师，事半功倍，可以大大增加您的学习成绩！</p>
							</div>
							<div class="section_box_inside_step_introduce_box">
								<div>
									<h4>4、官网认证，更加权威，学习机会更多</h4>
								</div>
								<p>请您尽快将孩子的学习状态到网站上，认证的学员我们将优先推荐家教。</p>
								<p class="color_button_showinfo">网上认证</p>
							</div>

						</div>
					</div>
					<!--
                        	作者：972893248@qq.com
                        	时间：2017-11-10
                        	描述：右侧变化窗口2个人信息
                        -->
					<div
						class="section_box_inside_change_menuinfo2 clearfix section_box_left_div_comment_bywujinshan">
						<div class="personal_box_info">
							<h4>身份信息</h4>
							<p class="order_number_showInfo">您可以在个人资料页面选择上传个性头像</p>
							<div class="order_number_showInfo_box">
								<div class="big_title">
									基本资料<span id="modify_info">修改</span>
								</div>
								<div class="underline_div">
									真实姓名：<input type="text" id="update_form_name_check"
										value="${personalCenterInfos.teacherRealName}" /><span
										class="info_unselect" id="update_form_name_show">${personalCenterInfos.teacherRealName}</span>
								</div>
								<div class="underline_div">
									性别： <select id="update_form_sex_check">
										<c:if test="${personalCenterInfos.teacherSex=='男'}">
											<option value="男" selected="selected">男</option>
											<option value="女">女</option>
										</c:if>
										<c:if test="${personalCenterInfos.teacherSex=='女'}">
											<option value="男">男</option>
											<option value="女" selected="selected">女</option>
										</c:if>


									</select> <span class="info_unselect" id="update_form_sex_show">${personalCenterInfos.teacherSex}</span>
								</div>
								<div class="underline_div">
									就读学校：<input type="text" id="update_form_school_check"
										value="${personalCenterInfos.teacherUniversity}" /><span
										class="info_unselect" id="update_form_school_show">${personalCenterInfos.teacherUniversity}</span><input
										type="text" class="maj_sub" id="update_form_major_check"
										value="${personalCenterInfos.teacherSpeciality}" /><span
										class="info_unselect" id="update_form_major_show">${personalCenterInfos.teacherSpeciality}</span>
								</div>

								<div class="underline_div">
									籍贯：<input type="text" id="update_form_country_check"
										value="${personalCenterInfos.teacherNative}" /><span
										class="info_unselect" id="update_form_country_show">${personalCenterInfos.teacherNative}</span>
								</div>
								<div class="underline_div">
									注册时间：<input type="text" id="update_form_retime_check"
										value="${personalCenterInfos.teacherRegisterDate}" /><span
										class="info_unselect" id="update_form_retime_show">${personalCenterInfos.teacherRegisterDate}</span>
								</div>
								<div class="underline_div">
									联系方式：<input type="text" id="update_form_phone_check"
										value="${personalCenterInfos.teacherPhone}" /><span
										class="info_unselect" id="update_form_phone_show">${personalCenterInfos.teacherPhone}</span>
								</div>
								<div class="comment_large_div">
									自我评价：
									<textarea class="comment_large" id="update_form_comment_check">${personalCenterInfos.selfmark}</textarea>
									<span class="info_unselect" id="update_form_comment_show">${personalCenterInfos.selfmark}</span>
								</div>
								<div class="hide_input first_line">
									身份证件：<input type="text" id="update_form_identity_check"
										value="${personalCenterInfos.teacherIdentity}" /><span
										class="info_unselect" id="update_form_identity_show">${personalCenterInfos.teacherIdentity}</span>
								</div>
								<div class="hide_input">
									现居地：<input type="text" id="update_form_address_check"
										value="${personalCenterInfos.addressName} ${personalCenterInfos.addressDesc}" /><span
										class="info_unselect" id="update_form_address_show">${personalCenterInfos.addressName},
										${personalCenterInfos.addressDesc}</span>
								</div>
								<div class="hide_input">
									<input type="button" value="保存" class="button_save"
										id="send_newacts" />
								</div>
							</div>
						</div>
					</div>
					<!--
                        	作者：972893248@qq.com
                        	时间：2017-11-10
                        	描述：右侧变化窗口3
                        -->
					<div
						class="section_box_inside_change_menuinfo3 clearfix section_box_left_div_comment_bywujinshan">
						<div>
							<h4>
								尊敬的学员！您有<span class="order_number">0</span>笔家教订单代支付!
							</h4>
							<p class="order_number_infounder">由于家教信息具有很强时效性，请尽快完成支付谢谢配合。</p>
						</div>
						<div class="order_table">
							<table class="order_table_operate">
								<caption>待付订单</caption>
								<tr>
									<th>订单号</th>
									<th>所在区域</th>
									<th>求教科目</th>
									<th>待付金额</th>
									<th>接单时间</th>
									<th>操作</th>
								</tr>
								<c:forEach items="${personalCenterInfos.teacherOrderNotPayList}"
									var="orderNotPay">
									<tr>
										<td>${orderNotPay["orderId"]}</td>
										<td>${orderNotPay["addressName"]}</td>
										<td>${orderNotPay["subjectName"]}</td>
										<td><span>￥</span>${orderNotPay["price"]}</td>
										<td>${orderNotPay["orderBeginTime"]}</td>

										<td><span class="confirm_order">确认订单</span><span>|</span><span
											class="delate_order">删除订单</span></td>
									</tr>
								</c:forEach>
							</table>
						</div>

					</div>

					<!--
                        	作者：972893248@qq.com
                        	时间：2017-11-11
                        	描述：右侧变化窗口4
                        -->
					<div
						class="section_box_inside_change_menuinfo4 section_box_left_div_comment_bywujinshan">
						<div>
							<h4>
								<span class="order_record">徐磊</span>的订单申请记录
							</h4>
							<p>如下是您最近申请过的订单，某些申请记录可能因为特殊原因未被展示。</p>
						</div>
						<div class="order_table_jiajiao_record">
							<table class="order_table_offer">
								<caption>家教申请记录</caption>
								<tr>
									<th>订单号</th>
									<th>申请时间</th>
									<th>年级科目</th>
									<th>状态</th>
									<th>订单报酬</th>
								</tr>
								<c:forEach items="${personalCenterInfos.teacherOrderTotal}"
									var="orderTotal">
									<tr>
										<td>${orderTotal["orderId"]}</td>
										<td>${orderTotal["orderBeginTime"]}</td>
										<td>${orderTotal["subjectName"]}</td>
										<td><c:if test="${orderTotal['isPushToIndex']==1}">
												<c:out value="已处理" />
											</c:if> <c:if test="${orderTotal['isPushToIndex']==0}">
												<c:out value="正在处理" />
											</c:if></td>
										<td><span>￥</span>${orderTotal["price"]}</td>

									</tr>

								</c:forEach>
							</table>
						</div>

					</div>

					<!--
                        	作者：972893248@qq.com
                        	时间：2017-11-11
                        	描述：右侧变化窗口5
                        -->
					<div
						class="section_box_inside_change_menuinfo5 section_box_left_div_comment_bywujinshan">
						<div>
							<h4>
								<span class="order_record_jiaoyuan">徐磊</span>的成功家教记录
							</h4>
							<p>成功记录是您过往在家教GDZ接受聘用并持续学习的历史记录，成功记录丰富，老师将会更愿意选择您任教。</p>
						</div>
						<div class="order_table_record_teacher">
							<table class="order_table_record_offer_teacher">
								<caption>家教记录</caption>
								<tr>
									<th>订单号</th>
									<th>申请时间</th>
									<th>年级科目</th>
									<th>学生编号</th>
									<th>完成时间</th>
									<th>本次报酬</th>
								</tr>

								<c:forEach items="${personalCenterInfos.teacherOrderSuccess}"
									var="orderSuccess">
									<!-- 									<c:if test="${orderSuccess['isPay']==1}"> -->
									<tr>


										<td>${orderSuccess["orderId"]}</td>
										<td>${orderSuccess["orderBeginTime"]}</td>
										<td>${orderSuccess["subjectName"]}</td>
										<td>${orderSuccess["studentId"]}</td>
										<td>${orderSuccess["orderFinishTime"]}</td>
										<td>￥<span>${orderSuccess["price"]}</span></td>

									</tr>
									<!-- 									</c:if> -->
								</c:forEach>

							</table>
						</div>
					</div>

					<!--
                        	作者：972893248@qq.com
                        	时间：2017-11-11
                        	描述：右侧变化窗口6重置密码
                        -->
					<div
						class="section_box_inside_change_menuinfo6 section_box_left_div_comment_bywujinshan">
						<h2>修改密码</h2>
						<form>
							<div>
								<label class="section_box_inside_change_menuinfo6_limit" >原密码：</label>
								<input type="text" class="old_pwd" id="oldPwd_input"/>
							</div>
							<div>
								<label class="section_box_inside_change_menuinfo6_limit">新密码：</label>
								<input type="text" class="new_pwd" id="newPwd_input"/>
							</div>
							<div>
								<label>再次输入新密码：</label> <input type="text" class="new_pwd" />
							</div>
							<button type="submit" class="reset_pwd_buttom" id="changePwd">确认修改</button>
						</form>
					</div>
					<!--
                        	作者：972893248@qq.com
                        	时间：2017-11-10
                        	描述：右侧变化窗口7注销
                        -->
					<div
						class="section_box_inside_change_menuinfo7 section_box_left_div_comment_bywujinshan">
						<div>
							<h4>账户注销</h4>
							<p class="notice_info">
								亲爱的用户<span class="underline_now_user">${personalCenterInfos.teacherUserName}</span>，您确定要注销您的当前账户么？一旦注销您将失去您的所有订单信息和基本资料。
							</p>
							<p class="notice_info">如果您已经决定注销，请输入密码以便核实身份》》</p>
							<img src="/GDZjiajiaowang/source/img/seeyougoodbye.png" />
							<p class="notice_info_last">不在考虑下么？</p>
						</div>
						<div class="notice_box_right">
							<input type="text" placeholder="输入密码" /> <input type="button"
								value="确定" />
							<div class="img_password">图片验证</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		</div>
		<!--这是一块灰色色块，无实际作用-->
		<p class="section_box_extra_useless"></p>
		</div>
	</section>

	<!--
        	作者：972893248@qq.com
        	时间：2017-11-10
        	描述：footer
        -->
	<footer>
		<div>
			<div class="footer_top">
				<p>
					<span>推荐学科</span>
				<p>初中英语 初二数学 初三语文 初二数学 初三语文 初二数学 初三语文 初二数学 初三语文 初二数学 初三语文 初二数学
					初三语文 初二数学 初三语文 初二数学 初三语文</p>
				</p>
				<p>
					<span>相关城市</span>
				<p>南京家教 北京家教 宁波家教 广州家教 烟台家教 浙江家教 温州家教 宿迁家教 太原家教 贵州家教 福州家教 济南家教
					昆明家教 合肥家教</p>
				</p>
			</div>
			<div class="footer_bottom">
				<div class="clearfix footer_bottom_inside">
					<ul>
						<li><a href="#"><img
								src="/GDZjiajiaowang/source/img/22.png" /></a></li>
					</ul>
					<ul>
						<li>关于我们</li>
						<li>了解GDZ家教</li>
						<li>加入我们</li>
						<li>联系我们</li>
					</ul>
					<ul>
						<li>帮助中心</li>
						<li>初次使用家教网</li>
						<li>校企合作</li>
						<li>基础价格</li>
					</ul>
					<ul>
						<li>友情链接</li>
						<li>GDZ数学网</li>
						<li>GDZ北大青鸟</li>
						<li>GDZ多艺网</li>
					</ul>
					</ul>
					<ul>
						<li>关注我们</li>
						<li><img src="/GDZjiajiaowang/source/img/20.png" height="80"
							width="80" /></li>
						<li>扫一扫马上请家教</li>
					</ul>
					<ul>
						<li><img src="/GDZjiajiaowang/source/img/21.png" alt="" /></li>
						<li>请家教热线：890-887-8766</li>
						<li>投诉反馈：JDZ1412@163.com</li>
					</ul>
				</div>
			</div>
			<div class="fotter_black"></div>
		</div>
	</footer>
	<script type="text/javascript">
	
		$('#send_newacts')
				.click(
						function() {
						alert("ok.....")
							var name_check = $('#update_form_name_check').val();
							var sex_check = $('#update_form_sex_check').val();
							var school_check = $('#update_form_school_check').val();
							var major_check = $('#update_form_major_check').val();
							var retime_check = $('#update_form_retime_check').val();
							var phone_check = $('#update_form_phone_check').val();
							var comment_check = $('#update_form_comment_check').val();
							var identity_check = $('#update_form_identity_check').val();
							var job_check = $('#update_form_job_check').val();
							var reward_check = $('#update_form_reward_check').val();
							var subject_check = $('#update_form_subject_check').val();
							var address_check = $('#update_form_address_check').val();
							var teacherId=$("#teacher_no").text();
									$.ajax({
										type : "post",
										url : "http://localhost:8080/GDZjiajiaowang/PersonalCenterIdentityServlet",
										data :{"name_check" : name_check,
												 "sex_check" : sex_check,
												"school_check" :school_check,
												 "major_check" : major_check,
												"retime_check" : retime_check,
												 "phone_check" : phone_check,
												"comment_check" : comment_check,
												 "identity_check" : identity_check,
												 "job_check" :job_check,
												 "reward_check" : reward_check,
												 "subject_check" : subject_check,
												 "address_check": address_check,
												 "teacherId":teacherId
												 } ,
										dataType : "json",
										success : function(data) {
											alert("修改成功");
											$("#update_form_name_show").text(data.teacherRealName);
											$("#update_form_name_check").val(data.teacherRealName);
											
											$("#update_form_sex_show").text(data.teacherSex);
											$("#update_form_sex_check").find("option[value="+data.teacherSex+"]").attr("selected","selected");
											$("#update_form_sex_check").find("option[value="+data.teacherSex+"]").siblings().removeAttr("selected");
											$("#update_form_school_show").text(data.teacherUniversity);
											$("#update_form_school_check").val(data.teacherUniversity);
											
											$("#update_form_major_show").text(data.teacherSpeciality);
											$("#update_form_major_check").val(data.teacherSpeciality);
											
											$("#update_form_country_show").text(data.teacherNative);
											$("#update_form_country_check").val(data.teacherNative);
											
											$("#update_form_retime_show").text(data.teacherRegisterDate);
											$("#update_form_retime_check").val(data.teacherRegisterDate);
											
											$("#update_form_phone_show").text(data.teacherPhone);
											$("#update_form_phone_check").val(data.teacherPhone);
											
											$("#update_form_name_show").text(data.teacherRealName);
											$("#update_form_name_check").val(data.teacherRealName);
											
											$("#update_form_comment_show").text(data.selfmark);
											$("#update_form_comment_check").val(data.selfmark);
											
											$("#update_form_identity_show").text(data.teacherIdentity);
											$("#update_form_identity_check").val(data.teacherIdentity);
											
											$("#update_form_job_show").text(data.type);
											$("#update_form_job_check").val(data.type);
											
											$("#update_form_reward_show").text(data.certificate);
											$("#update_form_reward_check").val(data.certificate);
											
// 											$("#update_form_subject_show").text(data.subjectName);
// 											$("#update_form_subject_check").val(data.subjectName);
														
										},
									})

						})
						
						
				//更改密码
				$("#changePwd").click(function(){
					var oldPwd_input=$(this).parent().find("#oldPwd_input").val();
					var newPwd_input=$(this).parent().find("#newPwd_input").val();
					var phoneNum=$("#update_form_phone_show").text();					
					oldPwd_input=$.md5(phoneNum+oldPwd_input+phoneNum);
					newPwd_input=$.md5(phoneNum+newPwd_input+phoneNum);
					var json={
					"oldPwd_input":oldPwd_input,
					"newPwd_input":newPwd_input,
					"phoneNum":phoneNum,
					"teacherId":${personalCenterInfos.teacherId}
					}
					$.ajax({
						type : "post",
						url : "/GDZjiajiaowang/PersonalCenterChangePwdServlet",
						data : json,
						dataType : "json",
						contentType : "application/x-www-form-urlencoded; charset=utf-8",
						success : function(data) {
							alert("修改成功");
							alert(data);
						}
					
					})
				
				})
	</script>
	</ body>
</html>
